package Assignment;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你存入的金额：");
        double  money = scanner.nextDouble();

        System.out.println("请输入存入年限：");
        int year = scanner.nextInt();

        //本息计算方式：本金+本金×年利率×年限

        if (money > 1000){
            if (year>=1){
                switch (year){
                    case 1 -> money = money+money*year*0.0225;
                    case 2 -> money = money+money*year*0.027;
                    case 3,4 -> money = money+money*year*0.0325;
                    default -> money = money+money*year*0.036;

                }
                System.out.println("金额为："+money);
            }else{
                System.out.println("年限最低为1年");
            }
        }
        else {
            System.out.println("金额1000起存");
        }

    }
}
